VR10BinToUBy

V = Variables

R = Reading functions

BINARIO —→ UNSIGNED BYTE

The VR10BinToUBy function converts a binary variable type in an Unsigned Byte type (byte without sign).

IMPLEMENTATION

VR10BinToUBy (array, index, return, errcode)

Parameters:

IN/OUTVARIABLE TYPEEXAMPLE NAMEDIM
IN ARRGBL array B Array containing the data to be converted (must be declared at least “index” elements)
IN GLOBAL index L Index of the array element at the beginning data
OUT GLOBAL return W Data value converted
OUT GLOBAL errcode F Variable that indicates a possible error on the function

Errcode

Una volta richiamata la funzione, 'errcode' può assumere determinati valori, il significato di tali valori è riassunto di seguito:
0: Nessun errore

Esempio

Trasforma il valore -20 (binario) in un valore unsigned byte

index = 1
array[1] = -20
 
VR10BinToUBy (array, index, return, errcode)
 
;Sul dato return  si troverà :
; return = 236

Note